package org.jeecg.modules.platform.api;

import io.swagger.annotations.ApiModelProperty;
import org.jeecg.common.constant.ServiceNameConstants;
import org.jeecg.modules.platform.fallback.PlatformOrganizationMemberPermissionFallback;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingClass;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@Component
@FeignClient(contextId = "SysPlatformOrgMemberPermissionApi", value = ServiceNameConstants.SERVICE_SYSTEM, path = ServiceNameConstants.PATH_MEMBER_PERMISSION, fallback = PlatformOrganizationMemberPermissionFallback.class)
@ConditionalOnMissingClass("org.jeecg.modules.platform.member.controller.CyPlatformOrganizationMemberPermissionController")
public interface PlatformOrganizationMemberPermissionApi {

    @GetMapping("listPermissionRules")
    @ApiModelProperty("查询用户拥有的权限")
    List<String> listPermission(@RequestParam(name = "userId", required = false) String userId, @RequestParam(name = "moduleId", required = false) String moduleId);
}
